<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Class_Bind</title>
    <script src="../Vue.js"></script>
    <style>
        .color{
            width: 200px;
            height: 200px;
        }
        .active{
            background-color: skyblue;
            display: block;
        }
    </style>
</head>
<body>

    <div id="app">
        <!--active类存在与否将取决于数据isActive-->
        <div v-bind:class="{active:isActive}" class="color"></div>
        <div :class="[activeClass, errorClass]"></div>
    </div>

    <script>
        var app = new Vue({
            el: "#app",
            data:{
            	isActive:true,
                activeClass:'active',
                errorClass:'text-danger'
            }
        })
    </script>
</body>
</html>